Skip to content

dgb(Phase-B): SSOT pool efficiency / real-hashrate diagnostics + non-circular KAT - #389

Merged
frstrtr merged 1 commit into
masterfrom
dgb/pool-efficiency-real-hashrate-ssot
Jun 24, 2026
Merged

dgb(Phase-B): SSOT pool efficiency / real-hashrate diagnostics + non-circular KAT#389
frstrtr merged 1 commit into
masterfrom
dgb/pool-efficiency-real-hashrate-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What

Next Phase-B pillar: lift the pool efficiency / real-hashrate diagnostics arithmetic out of node.cpp into a header-only SSOT (src/impl/dgb/pool_efficiency.hpp):

  • compute_stale_prop(orphan, doa, total) = (orphan+doa)/total, 0.0 on empty window
  • compute_real_pool_hashrate(pool_hs, stale_prop) = pool_hs / (1 - stale_prop) when stale_prop < 0.999 && pool_hs > 0, else pool_hs

Why

These are open-coded inline in node.cpp:1712-1767 feeding the Pool: <hashrate> ... Expected time to block: status line. A silent drift (flipped guard, wrong denominator, dropped div-by-~0 floor) would misreport effective hashrate / ETB with no compile error — operator-facing behavior the V36 master-compat invariant pins to the p2pool reference.

Oracle: p2pool-dgb-scrypt main.py status loop — real_att_s = get_pool_attempts_per_second(...) / (1 - stale_prop).

Scope / safety

  • FENCED / additive: node.cpp NOT yet rewired (byte-identity delegation is the follow-on). Pure arithmetic, consensus-neutral.
  • Non-circular KAT, 8/8 green locally — expected values hand-derived from the oracle formula, not produced by the helper under test.
  • Registered in test CMakeLists.txt + both build.yml --target allowlists (ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT guard).
  • Per-coin isolation: src/impl/dgb/ only.

NO self-merge — surfaced for tap.

…circular KAT

Lift the pool EFFICIENCY / REAL-HASHRATE diagnostics arithmetic out of
node.cpp into a header-only SSOT (pool_efficiency.hpp):
  - compute_stale_prop(orphan, doa, total) = (orphan+doa)/total, 0 on empty
  - compute_real_pool_hashrate(pool_hs, stale_prop) =
        pool_hs / (1 - stale_prop)  when stale_prop < 0.999 && pool_hs > 0
        pool_hs                     otherwise

Mirrors the p2pool-dgb-scrypt oracle main.py status loop
(real_att_s = get_pool_attempts_per_second(...) / (1 - stale_prop)),
operator-facing behavior pinned by the V36 master-compat invariant.

FENCED/additive: node.cpp NOT yet rewired (byte-identity delegation is the
follow-on). Pure arithmetic, consensus-neutral. Non-circular KAT (8/8) pins
hand-derived oracle values. Registered in test CMakeLists + both build.yml
--target allowlists (#143 NOT_BUILT guard).
@frstrtr
frstrtr force-pushed the dgb/pool-efficiency-real-hashrate-ssot branch from c171a33 to 32e78b3 Compare June 23, 2026 23:26
@frstrtr
frstrtr merged commit b5db325 into master Jun 24, 2026
33 checks passed
frstrtr added a commit that referenced this pull request Jun 24, 2026
dgb: delegate heartbeat_log diagnostics arithmetic to #389/#390 SSOTs (byte-id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant